//函子
class Container {
    constructor(value) {
        this._value = value
    }
    map(fn) {
        return new Container(fn(this._value))
    }
}

const obj = new Container(5).map(i => i + 1).map(x => x * x)
console.log(obj)

